- 
                Notifications
    
You must be signed in to change notification settings  - Fork 273
 
feat(amazonq): skip registering run command log file #5493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
983f9b1    to
    4fbd7bf      
    Compare
  
            
          
                ...rc/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationState.kt
              
                Fixed
          
            Show fixed
            Hide fixed
        
      8ac0a97    to
    dffd769      
    Compare
  
    961d59d    to
    aca090b      
    Compare
  
            
          
                ...rc/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationState.kt
              
                Fixed
          
            Show fixed
            Hide fixed
        
      26185ba    to
    3e05b4e      
    Compare
  
            
          
                ...oftware/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationStateTest.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | val mutableNewFileContents = codeGenerationStreamResult.new_file_contents.toMutableMap() | ||
| val keysToRemove = mutableListOf<String>() | ||
| for (file in mutableNewFileContents.keys) { | ||
| if (file.endsWith(".amazonq/dev/run_command.log")) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this path OS specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path is a placeholder value and won't interact with filesystem.
Using const. Thanks.
| val mutableNewFileContents = codeGenerationStreamResult.new_file_contents.toMutableMap() | ||
| val keysToRemove = mutableListOf<String>() | ||
| for (file in mutableNewFileContents.keys) { | ||
| if (file.endsWith(".amazonq/dev/run_command.log")) { | ||
| val contents: String = mutableNewFileContents[file].orEmpty() | ||
| logger.info(contents) { "Run command log: $contents" } | ||
| keysToRemove.add(file) | ||
| } | ||
| } | ||
| keysToRemove.forEach { key -> mutableNewFileContents.remove(key) } | ||
| 
               | 
          ||
| val newFileInfo = registerNewFiles(newFileContents = mutableNewFileContents) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| val mutableNewFileContents = codeGenerationStreamResult.new_file_contents.toMutableMap() | |
| val keysToRemove = mutableListOf<String>() | |
| for (file in mutableNewFileContents.keys) { | |
| if (file.endsWith(".amazonq/dev/run_command.log")) { | |
| val contents: String = mutableNewFileContents[file].orEmpty() | |
| logger.info(contents) { "Run command log: $contents" } | |
| keysToRemove.add(file) | |
| } | |
| } | |
| keysToRemove.forEach { key -> mutableNewFileContents.remove(key) } | |
| val newFileInfo = registerNewFiles(newFileContents = mutableNewFileContents) | |
| val fileContents = codeGenerationStreamResult.new_file_contents.filterKeys { file -> | |
| if (file.endsWith(".amazonq/dev/run_command.log")) { | |
| val contents: String = mutableNewFileContents[file].orEmpty() | |
| logger.info(contents) { "Run command log: $contents" } | |
| true | |
| } else { | |
| false | |
| } | |
| } | |
| val newFileInfo = registerNewFiles(newFileContents = fileContents) | 
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
0866120    to
    0155aea      
    Compare
  
    
Types of changes
Description
Problem:
Users currently cannot access logs generated by the Agent when it executes user commands during code generation.
Solution:
The logs emitted by the Agent during user command execution will be accepted and written to the
logsin the user's local repository. This ensures that:Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.